﻿#include "FITKVTKViewAdaptorBase.h"

// Graph and data
#include "FITK_Kernel/FITKCore/FITKAbstractNDataObject.h"
#include "FITKGraphObject3D.h"

// Case
#include "FITK_Component/FITKAbaqusData/FITKDataCaseManager.h"
#include "FITK_Component/FITKAbaqusData/FITKDataCase.h"
#include "FITK_Component/FITKAbaqusData/FITKAbaqusData.h"

namespace Exchange
{
    void FITKVTKViewAdaptorBase::setDataObject(Core::FITKAbstractDataObject* data)
    {
        if (data && data != _dataObj)
        {
            m_needUpdate = true;
        }

        Adaptor::FITKAbstractViewAdaptor::setDataObject(data);
    }

    void FITKVTKViewAdaptorBase::setDetails(QVariant details)
    {
        // Set the details information for exchanging data.
        m_details = details;
    }

    void FITKVTKViewAdaptorBase::setStep(int stepId)
    {
        m_stepId = stepId;
    }

    void FITKVTKViewAdaptorBase::setCaseData(AbaqusData::FITKDataCase* caseData)
    {
        if (caseData)
        {
            m_caseData = caseData;
        }
    }

    FITKGraphObject3D* FITKVTKViewAdaptorBase::getOutputData()
    {
        // The data exchanged to the output
        return m_outputData;
    }

    bool FITKVTKViewAdaptorBase::update()
    {
        // override in subclass
        return true;
    }
}   // namespace Exchange
